pub fn convert_base(num_str: &str, to_base: u32) -> String {
    let number_str = num_str.split('(').nth(0).unwrap();
    let radix_str = num_str.split('(').nth(1).unwrap().trim_matches(')');

    let radix = radix_str.parse::<u32>().unwrap();
    let decimal_num = u32::from_str_radix(number_str, radix).unwrap();

    let mut result = String::new();
    let mut num = decimal_num;

    while num > 0 {
        let remainder = num % to_base;
        let digit = if remainder < 10 {
            (remainder as u8 + b'0') as char
        } else {
            (remainder as u8 - 10 + b'a') as char
        };
        result.push(digit);
        num /= to_base;
    }

    result.chars().rev().collect()
}
